package com.feidee.fd.sml.algorithm.component.validation

import org.apache.spark.sql.DataFrame

/**
  * @Author songhaicheng
  * @Date 2019/5/14 15:59
  * @Description
  * @Reviewer
  */
case class Morpher(className: String, params: String) {

  def this() = this(null, null)

  def apply(data: DataFrame, className: String, params: String, validationParam: ValidationParam): Boolean = {
    val clazz = Class.forName(className)
    clazz.getDeclaredMethod("apply", classOf[DataFrame], classOf[String], classOf[ValidationParam])
      .invoke(clazz.newInstance(), data, params, validationParam)
      .asInstanceOf[Boolean]
  }
}
